package com.huanong.it.xwcommon.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@TableName("weibos")
@Data
public class Weibo {
    @TableId("wb_id")
    private int id;
    @TableField("wb_user_loginname")
    private String userLoginName;
    @TableField("wb_title")
    private String title;
    @TableField("wb_content")
    private String content;
    @TableField("wb_createtime")
    private Date createTime;
    @TableField("wb_readcount")
    private int readCount;
    @TableField("wb_img")
    private String img;
    @TableField("wb_state")
    private int state;

    //扩充的信息统统都放在Map中(例如从其他微服务拿来的外键对象)
    @TableField(exist = false)
    private List<Comment> comments;

    @TableField(exist = false)
    private Map<String,Object> map=new HashMap<>();
    public Map<String, Object> getMap() {
        return map;
    }

}
